Ext.define('framenet.view.frameSearcher', {
	extend: 'Ext.window.Window',

	constructor: function(cfg) {
        var me = this;
        cfg = cfg || {};

        // create a store
        cfg.store = Ext.create('framenet.store.gridStore', {model: cfg.gridDataModel, entity: cfg.entity});

        me.callParent([Ext.apply({
    		title: 'Search',
    		modal: true,
    		autoShow: true,
    		layout: 'fit',
			items:[{
				xtype: 'frameGrid',
            	store: cfg.store,
            	columnModel: cfg.gridColModel,
            	showSearcher: true,
                listeners: {
                    'itemdblclick': function(sm, selectedRecord) {
                    	me.close();
                    	cfg.handler(selectedRecord);
                    }
                }
			}],
        }, cfg)]);
    }
});
